<?php $this->load->view('common/header'); ?>
<?php $this->load->view('common/menu'); ?>
<article class="window-box" data-background="">
    <article class="window-wrapper">

        <section class="banner_met_m1156_9_27 full" data-title="首页" m-id="27" m-type="banner">
            <div class="banner-box     banner-container">
                <div class="banner-wrapper">

                    <?php if ($banner['pc']) : ?>
                        <?php foreach ($banner['pc'] as $key => $val) : ?>
                            <div class="banner-slide">
                                <ul>
                                    <li class="banner-lazy fullheight"
                                        data-background="<?php echo $val['pic_url']; ?>">
                                        <img class="banner-lazy" data-src="<?php echo $val['pic_url']; ?>" alt="">
                                    </li>
                                </ul>
                                <div>
                                    <a href="<?php echo $val['link']; ?>" title="" target="_blank">
                                        <b>查看详情</b>
                                    </a>
                                </div>
                            </div>
                        <?php endforeach; ?>
                    <?php endif; ?>


                </div>
                <div class="banner-pagination"></div>
                <div class="banner-controls left"><i class="icon wb-chevron-left"></i></div>
                <div class="banner-controls right"><i class="icon wb-chevron-right"></i></div>
            </div>
        </section>

        <section class="product_list_met_m1156_9_4 lazy full" m-id="4" data-title="墙布系列"
                 data-background="<?php echo $viewmulu; ?>/1490331159.png">
            <div class="container">
                <div class="title-box">
                    <div class="title-name">
                        <strong>墙布系列</strong>
                        <span>PRODUCT</span>
                    </div>
                    <div class="product-ctrl ctrl-box swiper-no-swiping">
                        <span class="ctrl-left"><i class="icon fa-caret-left"></i></span>
                        <span class="ctrl-right"><i class="icon fa-caret-right"></i></span>
                    </div>
                </div>
                <div class="product-content">
                    <div class="product-box">
                        <div class="product-cut">

                            <?php if ($products) : ?>
                                <?php foreach ($products as $key => $val) : ?>

                                    <div class="product-bin">
                                        <a href="/product_show/<?php echo $val['id']; ?>.html" title="" target=_self>
                                            <font>
                                                <img class="product-lazy"
                                                     data-src="<?php echo $val['img']; ?>"
                                                     alt="">
                                            </font>
                                            <span>
                                <em><i class="icon fa-angle-right"></i></em>
                                <b><?php echo $val['title']; ?></b>
                                <p><?php echo $val['keyword']; ?></p>
                            </span>
                                        </a>
                                    </div>
                                <?php endforeach; ?>
                            <?php endif; ?>


                        </div>
                    </div>
                </div>
            </div>
        </section>

        <section class="show_list_met_m1156_9_5 lazy full" m-id="5" data-title="关于"
                 data-background="<?php echo $viewmulu; ?>/1490598854.jpg">
            <div class="container">
                <div class="title-box">
                    <div class="title-name show-name">
                        <strong>关于</strong>
                        <span>ABOUT US</span>
                    </div>
                    <div class="show-title show-ctrl ctrl-box swiper-no-swiping">
                        <span class="ctrl-left"><i class="fa fa-caret-left"></i></span>
                        <span class="ctrl-right"><i class="fa fa-caret-right"></i></span>
                    </div>
                </div>
                <div class="show-box">
                    <ul class="show-cut">
                        <?php if ($about) : ?>
                            <?php foreach ($about as $key => $val) : ?>
                                <li class="show-bin">
                            <span class="left">
                                <a href="/page/<?php echo $val['title']; ?>.html" title="<?php echo $val['title']; ?>"
                                   target='_self'>
                                    <img class="show-lazy" data-src="<?php echo $val['img']; ?>">
                                </a>
                            </span>
                                    <span class="right">
                                <a href="/page/<?php echo $val['title']; ?>.html" title="<?php echo $val['title']; ?>"
                                   target='_self'><h3><?php echo $val['title']; ?></h3></a>
                                <i>&nbsp;</i>
                                <p><?php echo $val['desc']; ?></p>
                            </span>
                                </li>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </ul>
                    <div class="show-ctrl ctrl-box swiper-no-swiping">
                        <span class="ctrl-left"><i class="fa fa-caret-left"></i></span>
                        <span class="ctrl-right"><i class="fa fa-caret-right"></i></span>
                    </div>
                </div>
            </div>
        </section>

        <section class="message_list_met_m1156_9_6 lazy full" m-id="6" data-title="联系"
                 data-background="<?php echo $viewmulu; ?>/1490254947.png">
            <div class="container">
                <div class="title-box">
                    <div class="title-name">
                        <strong>联系</strong>
                        <span>CONTANT</span>
                    </div>
                    <div class="message-ctrl ctrl-box swiper-no-swiping">
                        <span class="ctrl-left"><i class="fa fa-caret-left"></i></span>
                        <span class="ctrl-right"><i class="fa fa-caret-right"></i></span>
                    </div>
                </div>
                <div class="message-box">
                    <div class="message-cut">
                        <div class="message-bin message-list">
                            <div class="met-form met-form-validation">
                                <input type='hidden' name='lang' value='cn'/>
                                <div class='form-group'>
                                    <input name='sub_name' class='form-control' type='text' placeholder='姓名 '
                                           data-fv-notempty="true" data-fv-message="不能为空" id="sub_name"/>
                                </div>
                                <div class='form-group'>
                                    <input name='sub_tel' class='form-control' type='tel' placeholder='电话 '
                                           data-fv-phone='true' data-fv-phone-message='电话格式错误' data-fv-notempty="true"
                                           data-fv-message="不能为空" id="sub_tel"/>
                                </div>
                                <div class='form-group'>
                                    <input name='sub_email' class='form-control' type='email' placeholder='邮箱 '
                                           data-fv-emailAddress='true' data-fv-emailaddress-message='邮箱格式错误'
                                           data-fv-notempty="true" data-fv-message="不能为空" id="sub_email"/>
                                </div>
                                <div class='form-group'>
                                    <textarea name='sub_con' class='form-control' data-fv-notempty="true"
                                              data-fv-message="不能为空" placeholder='留言内容 ' rows='5'
                                              id="sub_con"></textarea>
                                </div>
                                <div class="form-group m-b-0">
                                    <button type="submit" id="submit22" class="btn btn-primary btn-block btn-squared">
                                        提交留言
                                    </button>
                                </div>
                            </div>
                        </div>
                        <div class="message-bin message-right met-editor">
                            <div style="font-size:14px;">
                                <p><em class="fa fa-map-marker"></em> &nbsp; 地址：<?php echo $this->config->item('address'); ?></p>
                                <p><em class="fa fa-print"></em> &nbsp; 手机：<?php echo $this->config->item('telephone'); ?></p>
                                <p><em class="fa fa-envelope"></em> &nbsp; 邮箱：<?php echo $this->config->item('mail'); ?></p>
                                <p><em class="fa fa-phone"></em> &nbsp; 电话：<?php echo $this->config->item('phone'); ?></p>
                                <p><em class="fa fa-codepen"></em> &nbsp; 邮编：<?php echo $this->config->item('contact'); ?></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <script>
            $(document).on("click", "#submit22", function () {
                var name = $("#sub_name").val();
                var email = $("#sub_email").val();
                var tel = $("#sub_tel").val();
                var con = $("#sub_con").val();

                var reg = /\w+[@]{1}\w+[.]\w+/;
                if (email == '' || email == undefined) {
                    layer.alert("请输入email地址");
                    return false;
                }
                if (!reg.test(email)) {
                    layer.alert("请输入正确的email地址");
                    return false;
                }
                var url = "/message_add";
                $.ajax({
                    url: url,
                    type: "post",
                    data: {'name': name, 'tel': tel, 'email': email, 'con': con},
                    dataType: 'json',
                    success: function (data) {
                        console.log(data);
                        if (data.status == 1) {
                            layer.alert("留言成功", {
                                skin: 'layui-layer-lan'
                                , closeBtn: 1
                                , anim: 5 //动画类型
                            }, function (index) {
                                window.location.href = window.location.href;
                            });

                        } else {
                            layer.alert("留言失败");
                        }
                    }
                });
            });
        </script>
        <?php $this->load->view('common/footer'); ?>
